'use strict';

let a = [1,2,3];
let b = Buffer.from(a);
console.log(b);

let a2 = new Uint8Array([1,2,3]);
let b2 = Buffer.from(a2);
console.log(b2);

let b3 = Buffer.alloc(10);
console.log(b3);

let b4 = Buffer.allocUnsafe(10);
console.log(b4);

let buf =  Buffer.from('this is my pretty example');
let json = JSON.stringify(buf);
console.log(json)
let buf2 = Buffer.from(JSON.parse(json).data);
console.log(buf2.toString('utf8', 11, 17));



